package com.baizhi;


import com.baizhi.dao.CmfzBannerDao;
import com.baizhi.dao.CmfzMenuDao;
import com.baizhi.dao.CmfzUserDao;
import com.baizhi.entity.CmfzBanner;
import com.baizhi.entity.CmfzMenu;
import com.baizhi.service.AdminService;
import com.baizhi.service.CmfzMenuService;
import com.baizhi.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.*;

@RunWith(SpringRunner.class)
@SpringBootTest(classes =CmfzdemoApplication.class )
public class test {

    @Resource
    private CmfzMenuDao cmfzMenuDao;

    @Test
    public void test1(){
        List<CmfzMenu> cmfzMenus = cmfzMenuDao.selectAll();
        for (CmfzMenu cmfzMenu : cmfzMenus) {
            System.out.println(cmfzMenu);
        }
    }

    @Resource
    private CmfzBannerDao cmfzBannerDao;

    @Test
    public void test2(){
        List<CmfzBanner> cmfzBanners =
                cmfzBannerDao.selectList(null);

        for (CmfzBanner cmfzBanner : cmfzBanners) {
            System.out.println(cmfzBanner);
        }

    }

    @Resource
    private CmfzUserDao cmfzUserDao;

    @Test
    public void test3(){
        List<Integer> cmfzUsers = cmfzUserDao.selectCountSex();

        for (Integer cmfzUser : cmfzUsers) {
            System.out.println(cmfzUser);
        }

    }

//    @Test
//    public void test4(){
//        List<CmfzUser> cmfzUsers = cmfzUserDao.selectPro();
//
//        for (CmfzUser cmfzUser : cmfzUsers) {
//            System.out.println(cmfzUser);
//        }
//
//    }



    @Resource
    private UserService userService;


    @Test
    public void test4(){
        Map map = userService.selectAllCount();
        System.out.println(map);
    }

    @Resource
    private CmfzMenuService cmfzMenuService;


    @Test
    public void test5(){
        List<CmfzMenu> cmfzMenus = cmfzMenuService.selectAll();
        System.out.println("测试类执行结果:"+cmfzMenus);
    }
}
